import React from 'react';
import { Switch } from 'react-router-dom';
import AuthRoute from './AuthRoute';

export default ({ routes }) => {
  return (
    <Switch>
      {
        routes.map(({ id, exact, ...rest }) => {
          return (
            <AuthRoute key={id} exact={exact !== false} {...rest} />
          );
        })
      }
    </Switch>
  );
};
